package com.cfets.annualAssessment.service;

import com.cfets.annualAssessment.entity.commit;
import com.cfets.annualAssessment.mapper.CommitMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by ShenYiChou on 2017/2/3.
 */
@Service
public class CommitService {
    @Autowired
    private CommitMapper commitMapper;

    public boolean newCommit(commit commit) {
        return commitMapper.insertSelective(commit)>0;
    }

    public boolean updateCommit(commit commit) {
        return commitMapper.updateByPrimaryKey(commit)>0;
    }

    public commit findCommitById(int id) {
        return commitMapper.selectByPrimaryKey(id);
    }

    public List<commit> CommitList() {
        List<commit> commits = null;
        commits = commitMapper.selectAll();
        return commits;
    }
}
